package com.jinzecloud.reportapproval.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jinzecloud.reportapproval.bean.SpecificationSheetCheckSheet;
import com.jinzecloud.reportapproval.service.SpecificationSheetCheckSheetService;
import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.R;



/**
 * 产品规格表与技术产品文件一致性检查表
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2024-12-03 16:18:45
 */
@RestController
@RequestMapping("reportapproval/specificationsheetchecksheet")
public class SpecificationSheetCheckSheetController {
    @Autowired
    private SpecificationSheetCheckSheetService specificationSheetCheckSheetService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("reportapproval:specificationsheetchecksheet:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = specificationSheetCheckSheetService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("reportapproval:specificationsheetchecksheet:info")
    public R info(@PathVariable("id") Integer id){
		SpecificationSheetCheckSheet specificationSheetCheckSheet = specificationSheetCheckSheetService.getById(id);

        return R.ok().put("specificationSheetCheckSheet", specificationSheetCheckSheet);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("reportapproval:specificationsheetchecksheet:save")
    public R save(@RequestBody SpecificationSheetCheckSheet specificationSheetCheckSheet){
		specificationSheetCheckSheetService.save(specificationSheetCheckSheet);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("reportapproval:specificationsheetchecksheet:update")
    public R update(@RequestBody SpecificationSheetCheckSheet specificationSheetCheckSheet){
		specificationSheetCheckSheetService.updateById(specificationSheetCheckSheet);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("reportapproval:specificationsheetchecksheet:delete")
    public R delete(@RequestBody Integer[] ids){
		specificationSheetCheckSheetService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
